<?php
namespace app\admin\middleware;

class Auth
{
    public function handle($request, \Closure $next)
    {
        // var_dump(session('adminUser'));die;
        if (empty(session('adminUser')) && preg_match("/home/",$request->pathinfo())) {
            return redirect('/admin/index');
        }

        return $next($request);
    }
}